const attribute = 'attribute';

class Doctor {
  static hospital = 'huaxi';
  #count = 0;

  static hospitalName() {
    return `静态方法this指的是类 => ${this.hospital}`;
  }

  hospitalName() {
    return `类调用static => ${Doctor.hospital}`;
  }

  get getCount() {
    return this.#count;
  }

  increment() {
    this.#count++;
  }

  #privateFun() {
    return `私有方法 => #privateFun`;
  }

  printPrivateFun() {
    return this.#privateFun();
  }

  static getPrivateValue(doctor: Doctor) {
    return `私有属性不限于从this引用,只要是在类的内部,实例也可以引用私有属性 => ${doctor.#count}`;
  }
}

class Chaoyue extends Doctor {
  local: string;
  timer: number;
  instance: Doctor;

  name = 'chaoyuechaoyue';

  constructor(local: string, timer: number, docter: Doctor) {
    super();
    this.local = local;
    this.timer = timer;
    this.instance = docter;
  }

  get getInfo() {
    return `${this.name} + ${this.local} + ${this.timer}`;
  }

  set setTimer(date: number) {
    this.timer = date;
  }

  [attribute]() {
    this.setTimer = 20250401;
    return this.getInfo;
  }

  getClassName() {
    return Chaoyue.name;
  }

  inheritStatic() {
    return `继承static => ${Chaoyue.hospital}`;
  }
}

const doctor = new Doctor();
const chaoyue = new Chaoyue('chengdu', 2025, doctor);

/**
 * @returns {boolean} true
 * Chaoyue.prototype === chaoyue.__proto__
 * typeof Chaoyue === 'function'
 * Chaoyue === Chaoyue.prototype.constructor
 * chaoyue instanceof Chaoyue
 */


export default chaoyue;